/*
 * HelpCenterListItem.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.R;
import com.yidiandao.business.data.response.HelpResponse;
import com.yidiandao.business.ui.url.UrlActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.HelpCenterHolder;
import com.yidiandao.business.utils.UmengUtils;

/** 帮助中心ListItem. */
public class HelpCenterListItem
        extends DisplayListItem<HelpCenterHolder, HelpResponse.DataBean.ArticleListBean> {

    public HelpCenterListItem(HelpResponse.DataBean.ArticleListBean s) {
        super(s);
    }

    @Override
    public void onShow(final Context context, final HelpCenterHolder holder) {
        final String title = data.getTitle();
        final String url = data.getUrl();
        holder.mTvName.setText(title);
        holder.mRlInfo.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        UmengUtils.onEvent(context, R.string.umeng_suggestion_detail);
                        UrlActivity.actionStartWithoutShareFeature((Activity) context, url);
                    }
                });
    }

    @Override
    public String getDisplayItemTag() {
        return HelpCenterListItem.class.getSimpleName();
    }

    @Override
    public Class<HelpCenterHolder> getViewHolderClazz() {
        return HelpCenterHolder.class;
    }
}
